package cn.stylefeng.roses.kernel.conversion.controller;

import cn.stylefeng.roses.kernel.conversion.service.DocumentPreviewService;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 文档预览
 *
 * @author fengshuonan
 * @since 2023/10/20 22:12
 */
@RestController
@ApiResource(name = "文档预览")
public class DocPreviewController {

    @Resource
    private DocumentPreviewService documentPreviewService;

    /**
     * 通用文件预览接口，可以预览图片和office文档
     *
     * @author fengshuonan
     * @since 2023/10/20 22:14
     */
    @GetResource(name = "多文件预览", path = "/documentPreview")
    public void documentPreview(@RequestParam("fileId") Long fileId) {
        documentPreviewService.documentPreview(fileId);
    }

}
